package com.cet.regularexpression;

/**
 * @program: algorithm
 * @description:
 * @author: 陈恩涛
 * @create: 2021-06-21 16:42
 **/
public class Main06 {
    public static void main(String[] args) {
        String regex = "learn\\s(java|php|go)";
        System.out.println("learn java".matches(regex));
        System.out.println("learn php".matches(regex));
        System.out.println("learn go".matches(regex));
        System.out.println("learn Go".matches(regex));

        System.out.println("=================================");

        String ignoreCaseRegex = "learn\\s([jJ]ava|[pP]hp|[gG]o)";
        System.out.println("learn java".matches(ignoreCaseRegex));
        System.out.println("learn php".matches(ignoreCaseRegex));
        System.out.println("learn go".matches(ignoreCaseRegex));
        System.out.println("learn Go".matches(ignoreCaseRegex));
    }
}
